package com.gwtcx.sample.serendipity.server.guice;

import com.google.inject.persist.PersistFilter;
import com.google.inject.servlet.ServletModule;
import com.gwtplatform.dispatch.server.guice.DispatchServiceImpl;
import com.gwtplatform.dispatch.shared.ActionImpl;

public class SerendipityServletModule extends ServletModule {

	@Override
	protected void configureServlets() {
		bindConstants();
	    bindFilters();
	    bindServlets();
	}

	private void bindConstants() {
		
	}

	private void bindFilters() {
		filter("/*").through(PersistFilter.class);
	}

	private void bindServlets() {
		serve("/" + ActionImpl.DEFAULT_SERVICE_NAME).with(DispatchServiceImpl.class);
	}

}
